home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
datamgr
/
field.frm
< prev
next >
Wrap
Text File
|
1995-10-23
|
6KB
|
224 lines
VERSION 2.00
Begin Form FieldForm
BackColor = &H00C0C0C0&
BorderStyle = 3 'Fixed Double
Caption = "Field Form"
ClientHeight = 2235
ClientLeft = 315
ClientTop = 915
ClientWidth = 4605
Height = 2640
Left = 255
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2235
ScaleWidth = 4605
Top = 570
Width = 4725
Begin CheckBox cCounter
BackColor = &H00C0C0C0&
Caption = "&Counter"
Height = 255
Left = 1440
TabIndex = 12
Top = 1320
Visible = 0 'False
Width = 1335
End
Begin CommandButton Command2
Cancel = -1 'True
Caption = "&Cancel"
Height = 375
Left = 3120
TabIndex = 7
Top = 1680
Width = 1215
End
Begin CommandButton Command1
Caption = "&OK"
Default = -1 'True
Height = 375
Left = 1800
TabIndex = 6
Top = 1680
Width = 1215
End
Begin TextBox Text2
Height = 300
Left = 1440
TabIndex = 5
Top = 960
Width = 2895
End
Begin ComboBox Combo1
Height = 300
Left = 1440
Style = 2 'Dropdown List
TabIndex = 3
Top = 600
Width = 2895
End
Begin TextBox Text1
Height = 300
Left = 1440
TabIndex = 1
Top = 240
Width = 2895
End
Begin Label FSize
Caption = "Label6"
Height = 255
Left = 840
TabIndex = 11
Top = 1680
Visible = 0 'False
Width = 255
End
Begin Label fType
Caption = "Label5"
Height = 255
Left = 480
TabIndex = 10
Top = 1680
Visible = 0 'False
Width = 255
End
Begin Label FName
Caption = "Label4"
Height = 255
Left = 120
TabIndex = 9
Top = 1680
Visible = 0 'False
Width = 255
End
Begin Label ExitCondition
Height = 255
Left = 120
TabIndex = 8
Top = 1320
Visible = 0 'False
Width = 255
End
Begin Label Label3
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "Field &Size:"
Height = 375
Left = 240
TabIndex = 4
Top = 960
Width = 1095
End
Begin Label Label2
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "Field &Type:"
Height = 255
Left = 240
TabIndex = 2
Top = 600
Width = 1095
End
Begin Label Label1
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "Field &Name:"
Height = 255
Left = 240
TabIndex = 0
Top = 240
Width = 1095
End
End
Option Explicit
Sub Combo1_Click ()
If combo1.ItemData(combo1.ListIndex) = 4 Then 'Long Int
cCounter.Visible = True
Else
cCounter.Visible = False
End If
Select Case combo1.ItemData(combo1.ListIndex)
Case 10
label3.ForeColor = 0
text2.Enabled = True
Case Else
label3.ForeColor = QBColor(8)
text2.Text = ""
text2.Enabled = False
End Select
End Sub
Sub Command1_Click ()
Dim flag As Integer
flag = True
If text1 = "" Then
MsgBox "Invalid Field Name", 64, "Data Manager"
flag = False
text1.SetFocus
ElseIf combo1.ListIndex = -1 Then
MsgBox "You must select a valid field type", 64, "Data Manager"
flag = False
combo1.SetFocus
ElseIf combo1.ItemData(combo1.ListIndex) = 10 Then
If Val(text2) < 1 Or Val(text2) > 255 Then
MsgBox "Field Size (for Text Fields) must be between 1 and 255", 64, "Data Manager"
text2.SetFocus
flag = False
End If
End If
If flag Then
Me.ExitCondition = "OK"
Me.Hide
Me.FName = text1
Me.fType = combo1.ItemData(combo1.ListIndex)
If Me.fType = 10 Then
Me.FSize = text2
Else
Me.FSize = 0
End If
End If
End Sub
Sub Command2_Click ()
Me.ExitCondition = "Cancel"
Me.Hide
End Sub
Sub Form_Load ()
combo1.AddItem "Boolean"
combo1.AddItem "Byte"
combo1.AddItem "Integer"
combo1.AddItem "Long Integer"
combo1.AddItem "Currency"
combo1.AddItem "Single"
combo1.AddItem "Double"
combo1.AddItem "Date/Time"
combo1.AddItem "Text"
combo1.AddItem "Binary"
combo1.AddItem "Memo"
combo1.ItemData(0) = 1
combo1.ItemData(1) = 2
combo1.ItemData(2) = 3
combo1.ItemData(3) = 4
combo1.ItemData(4) = 5
combo1.ItemData(5) = 6
combo1.ItemData(6) = 7
combo1.ItemData(7) = 8
combo1.ItemData(8) = 10
combo1.ItemData(9) = 11
combo1.ItemData(10) = 12
End Sub